import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/components/Login'
import Home from '@/components/Home'
import UserIndex from '@/views/UserIndex'
//import UserComment from '@/views/UserComment'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login,
  },
  {
    path:'/home',
    name:'home',
    component: Home,
    redirect:'/home/firsthome',                              // 重定向到后台管理系统首页
    children:[
      // 首页router
      {
        path:'firsthome',
        name:'firstHome',
        component:() => import('@/views/FirstHome.vue'),
      },

      // 员工后台router
      {
        path:'userAddFiles',
        name:'userAddFiles',
        component:() => import('@/views/StatusEmployeeAddFiles.vue'),
      },
      {
        path:'userCreateActive',
        name:'userCreateActive',
        component:() => import('@/views/StatusEmployeeCreateActive.vue'),
      },{
        path:'userActiveList',
        name:'userActiveList',
        component:() => import('@/views/StatusEmployeeActiveList.vue'),
      },{
        path:'userProveJoin',
        name:'userProveJoin',
        component:() => import('@/views/StatusEmployeeProveJoin.vue'),
      },

      // 管理员后台router
      {
        path:'adminManage',
        name:'adminManage',
        component:() => import('@/views/AdminManage.vue'),
      },
      {
        path:'filesManage',
        name:'filesManage',
        component:() => import('@/views/FilesManage.vue'),
      },
      {
        path:'employeeManage',
        name:'employeeManage',
        component:() => import('@/views/EmployeeManage.vue'),
      },
      {
        path:'olderManage',
        name:'olderManage',
        component:() => import('@/views/OlderManage.vue'),
      },
      {
        path:'commentUser',
        name:'commentUser',
        component:() => import('@/views/CommentManage.vue'),
      },
      {
        path:'activeProve',
        name:'activeProve',
        component:() => import('@/views/ActiveProve.vue'),
      },
      {
        path:'detailActive',
        name:'detailActive',
        component:() => import('@/views/DetailActive.vue'),
        children:[
          {
            path:'comment',
            name:'comment',
            component:() => import('@/views/DetailActiveCommentDialogBox.vue'),
            props:true,
          }
        ]
      },
    ]
  },
  {
    path:'/index',
    name:'index',
    component: UserIndex
  }
  // {
  //   path:'/userComment',
  //   name:'userComment',
  //   component: UserComment
  // }
]

const router = new VueRouter({
  routes
})

export default router
